package com.sd365.permission.centre.dao.mapper;

import com.sd365.common.core.common.dao.CommonMapper;
import com.sd365.common.core.common.dao.CommonMapper;
import com.sd365.permission.centre.entity.Resource;
import com.sd365.permission.centre.pojo.dto.ResourceTreeDTO;
import com.sd365.permission.centre.pojo.query.ResourceQuery;
import com.sd365.permission.centre.pojo.vo.ResourceVO2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.HashMap;
import java.util.List;

@Mapper
public interface ResourceMapper extends CommonMapper<Resource> {
    /**
     * @param: 模糊查询条件
     * 1. 节点名称 name
     * 2. 父亲节点 parentId
     * @return: SubSystemDTOs
     * @see
     * @since
     */
    List<Resource> commonQuery(@Param("roleId")Long roleId);
    /**
     * 用于初始化redis,用于资源分配的查看
     * @return
     */
    List<ResourceVO2> commonQuery2(@Param("id")Long id);
    Resource findById(Long id);

    /**
     * 找到所有去重parentid和名称
     * @return
     */
    List<ResourceTreeDTO> getAllParentName();

    Resource findByParentId(Long parentId);

    Boolean updateResource(Resource resource);

    List<Resource> getResourceByRoleId(List<Long> list);


}
